<form id="usersaddfm" method="post" style="padding: 8px;">
	<table border="0" width="100%" cellspacing="1" cellpadding="5" class="formtable">
		<tr bgcolor="#FFFFFF">
			<td  class="tlabel"   width="20%">用户名：</td>
			<td width="80%"><input name="username" type="text" style="width:400px;" class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox" placeholder="请输入用户名.."  required="true"></td>
		<tr bgcolor="#FFFFFF">
			<td  class="tlabel"   width="20%">角色：</td>
			<td width="80%">
			<SELECT name='roles_id' style="width:153px; height:25px;" size='1' class="forminput inputstyle">
				<?php foreach($roles as $k=>$v):?>
				<OPTION value="<?php echo $v->id;?>"><?php echo $v->name;?></OPTION>
				<?php endforeach;?>
			</SELECT>
			</td>
		</tr>

		</tr>
		<tr bgcolor="#FFFFFF">
			<td  class="tlabel"   width="20%">密码：</td>
			<td width="80%"><input name="password" type="password" style="width:200px;"  class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox" placeholder="请输入密码.."></td>
		</tr>
		<tr bgcolor="#FFFFFF">
			<td  class="tlabel"   width="20%">重复密码：</td>
			<td width="80%"><input name="repassword" type="password" style="width:200px;"  class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox" placeholder="请输入重复密码.."></td>
		</tr>
		<tr bgcolor="#FFFFFF">
			<td  class="tlabel"   width="20%">状态：</td>
			<td width="80%"><input name="status" type="checkbox" class="textbox-prompt" value="1" checked="checked">激活</td>
		</tr>
</table>
</form>

<script>
$(function(){
		$('#usersaddsubmit').click(function(data){
				$('#usersaddfm').form('submit', {
					url:'/admin/system/usersadd',
					success: function(data){
						var data = eval('(' + data + ')');

						if(data.ret==0){
								$.messager.show({
										title:'提示',
										msg:data.msg,
										timeout:3000,
										showType:'slide'
								});
								$('#usersaddfm').form('clear');
								$("#usersdlg").dialog('close');
								$("#users").datagrid('reload');
						}else{
								$.messager.alert('提示',data.msg,'warning');
						}
					}
				});
		})
});
</script>
